﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true"
    CodeBehind="Cart.aspx.cs" Inherits="DoAnWeb.Cart" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style2
        {
            width: 80%;
        }
        .style3
        {
            height: 205px;
        }
        .style4
        {
            height: 25px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <br />
    <asp:Label ID="lbThongBao" runat="server" Font-Bold="True" ForeColor="#FF3300" Text="Bạn  vẫn chưa chọn mua sản phẩm nào."
        Visible="False"></asp:Label>
    <br />
    <br />
    <table cellpadding="0" cellspacing="0" class="style2" id="tbGioHang">
        <tr>
            <td align="left" class="style3">
                <asp:GridView ID="gvCartInfo" runat="server" AutoGenerateColumns="False" CellPadding="3"
                    DataKeyNames="MaTinKhuyenMai" OnDataBound="gvCartInfo_DataBound" OnRowDataBound="gvCartInfo_RowDataBound"
                    OnRowDeleting="gvCartInfo_RowDeleting" BackColor="White" BorderColor="#CCCCCC"
                    BorderStyle="None" BorderWidth="1px" Width="700px" OnSelectedIndexChanged="gvCartInfo_SelectedIndexChanged">
                    <Columns>
                        <asp:BoundField HeaderText="Sản phẩm">
                            <ItemStyle Width="300px" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="Đơn giá" DataFormatString="{0:#.#,##} VNĐ" />
                        <asp:TemplateField HeaderText="Số lượng">
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:TextBox ID="txtSoLuong" runat="server" Text='<%# Eval("SoLuong") %>'></asp:TextBox>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="Thành tiền" DataFormatString="{0:#.#,##} VNĐ" />
                        <asp:CommandField DeleteText="Xoá" ShowDeleteButton="True" HeaderText="Thao tác">
                            <ItemStyle Width="70px" />
                        </asp:CommandField>
                    </Columns>
                    <FooterStyle BackColor="White" ForeColor="#000066" />
                    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                    <RowStyle ForeColor="#000066" />
                    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                    <SortedAscendingHeaderStyle BackColor="#007DBB" />
                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                    <SortedDescendingHeaderStyle BackColor="#00547E" />
                </asp:GridView>
            </td>
        </tr>
        <asp:Panel ID="pnTongTien" runat="server">
            <tr>
                <td align="left">
                    <br />
                    Tổng tiền :
                    <asp:Label ID="lbTongTien" runat="server" ForeColor="Red"></asp:Label>
                    <br />
                    <br />
                </td>
            </tr>
        </asp:Panel>
    </table>
    <table cellpadding="0" cellspacing="0" class="style1">
        <tr>
            <asp:Panel ID="pnCapNhap" runat="server">
            <td align="left" valign="top" width="150">
                <asp:Button ID="btnCapNhat1" runat="server" Height="40px" OnClick="btnCapNhat_Click"
                    Text="Cập nhật" Width="130px" />
            </td>
            </asp:Panel>
            <asp:UpdatePanel ID="pnGioHang" runat="server">
                <ContentTemplate>
                    <td align="right" valign="top">
                        <asp:Button ID="btnThanhToan" runat="server" Height="40px" OnClick="btnThanhToan_Click"
                            Text="Thanh toán" Width="160px" ValidationGroup="ThanhToan" />
                        <table cellpadding="3" cellspacing="0" class="style1" width="500">
                            <tr>
                                <td align="center" colspan="2">
                                    Thông tin thanh toán
                                </td>
                            </tr>
                            <tr>
                                <td align="left" width="200">
                                    Họ tên :
                                </td>
                                <td align="left">
                                    <asp:TextBox ID="txtHoTen" runat="server" Width="200px" Style="margin-bottom: 0px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="rfvHoTen" runat="server" ControlToValidate="txtHoTen"
                                        ErrorMessage="Chưa nhập  họ tên." ForeColor="Red" ValidationGroup="ThanhToan">(*)</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="left" class="style4">
                                    Địa chỉ :
                                </td>
                                <td align="left" class="style4">
                                    <asp:TextBox ID="txtDiaChi" runat="server" Width="200px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="rfvDiaChi" runat="server" ControlToValidate="txtDiaChi"
                                        ErrorMessage="Chưa nhập địa chỉ." ForeColor="Red" ValidationGroup="ThanhToan">(*)</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    Số điện thoại :
                                </td>
                                <td align="left">
                                    <asp:TextBox ID="txtSoDienThoai" runat="server" Width="200px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="rfvSoDienThoai" runat="server" ControlToValidate="txtSoDienThoai"
                                        ErrorMessage="Chưa nhập số điện thoại." ForeColor="Red" ValidationGroup="ThanhToan">(*)</asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="rvDienThoai" runat="server" ControlToValidate="txtSoDienThoai"
                                        Display="Dynamic" ErrorMessage="Số điện thoại không hợp lệ." ForeColor="Red"
                                        SetFocusOnError="True" ValidationExpression="^[0-9]+$" ValidationGroup="ThanhToan">(*)</asp:RegularExpressionValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    Lời nhắn :
                                </td>
                                <td align="left" valign="middle">
                                    <asp:TextBox ID="txtLoiNhan" runat="server" Height="100px" TextMode="MultiLine" Width="350px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="rfvLoiNhan" runat="server" ControlToValidate="txtLoiNhan"
                                        ErrorMessage="Chưa nhập lời nhắn." ForeColor="Red" ValidationGroup="ThanhToan">(*)</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="left" colspan="2">
                                    <asp:ValidationSummary ID="ValidationSummary1" runat="server" ForeColor="Red" Style="text-align: left;
                                        margin-left: 0px;" ValidationGroup="ThanhToan" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </ContentTemplate>
            </asp:UpdatePanel>
        </tr>
    </table>
    <br />
</asp:Content>
